package com.memory.demo.service;

import com.memory.demo.dao.InimageDao;
import com.memory.demo.entity.Soul;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.Date;

@Service
public class KeepService {
    @Resource
    private InimageDao inimageDao;


    public  void  curupian(Soul soul){
        inimageDao.cunrutupian(soul);
    }

    public String keepimage(String str){

        String path=str.split("!")[0];
        String name=str.split("!")[1];
        Date time=new Date();
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        curupian(new Soul(path,name,formatter.format(time)));

        return "ojbk";
    }

}

